﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Data.SqlClient;
using System.Data;
using Automobile.service.Model;
using Automobile.service.DAL;

namespace Automobile.service.BLL
{
    public class ProductBll
    {
        ProductDal dal = new ProductDal();
        /// <summary>
        /// 商品信息分页显示
        /// </summary>
        /// <returns></returns>
        public List<ProductModel> ProductFenye(int PageSize,int PageIndex)
        {                                     
          return dal.ProductFenye(PageSize,PageIndex);
        }
          /// <summary>
        /// 显示商品信息
        /// </summary>
        /// <returns></returns>
        public List<ProductModel> Product()
        {
            return dal.Product();
        }
         //<summary>
         //获取信息总行数
         //</summary>
         //<returns></returns>
        public int GetProductCount()
        {
            return dal.GetProductCount();
        }
        /// <summary>
        /// 添加商品信息
        /// </summary>
        /// <param name="b"></param>
        /// <returns></returns>
        public int AddProduct(ProductModel pr)
        {
            return dal.AddProduct(pr);
        }
        /// <summary>
        ///修改商品信息
        /// </summary>
        /// <param name="em"></param>
        /// <returns></returns>
        public int UpdateProduct(ProductModel pro)
        {
            return dal.UpdateProduct(pro);
        }
       
        /// <summary>
        /// 删除商品信息
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public int DeleProduct(int id)
        {
            return dal.DelProduct(id);
        }
        /// <summary>
        /// 取单个商品信息
        /// </summary>
        /// <returns></returns>
        public DataTable GetProduct(string Product_Id)
        {
            return dal.GetProduct(Product_Id);
        }
    }
}
